home *** CD-ROM | disk | FTP | other *** search
Wrap
; ----------------------------------------------------- ; Peace and Protection (by misspai) ; ----------------------------------------------------- ; Sound and music support ; ----------------------------------------------------- ; CTCP SOUND support ; ----------------------------------------------------- ctcp 1:SOUND:*:_runsctcp $1- ctcp 1:MP3:*:if (.mp3 !isin $2-) _runsctcp SOUND $replace($2-,$chr(32),?) $+ .mp3 | elseif (.mp3 isin $2) _runsctcp SOUND $2- | else _runsctcp SOUND $replace($2-,$chr(32),?) ctcp 1:MP2:*:if (.mp2 !isin $2-) _runsctcp SOUND $replace($2-,$chr(32),?) $+ .mp2 | elseif (.mp2 isin $2) _runsctcp SOUND $2- | else _runsctcp SOUND $replace($2-,$chr(32),?) alias -l _runsctcp { _timersinc 15 -soundfld. $+ $site if (%-soundfld. [ $+ [ $site ] ] > 6) { .ignore -tu20 $wildsite disps %col.att $+ Ignoring CTCPs from %col.target $+ $wildsite $+ for 20 seconds to prevent lockup. (receiving too many SOUND requests.) } set %.ss.file $_ffprep($nopath($2)) | set %.+ss.play $true if (%-soundfld. [ $+ [ $site ] ] > 3) { set %.ss.color $remove(%col.dark,,,) | set %.ss.coloract $colour(act) unset %.ss.dir | goto dispit } set %.ss.color %col.base | set %.ss.coloract $colour(high) set %.ss.extn $_mapext($_rtok(1,46,%.ss.file)) if ((%.ss.extn == mp2) || (%.ss.extn == mp3)) set %.ss.extn mp if ((%sounds.halt) && (($inwave) || ($inmidi))) set %.+ss.play $false | else set %.+ss.play %+accept. [ $+ [ %.ss.extn ] ] if ((%.+ss.play) || (%+search.nonaccepts) || ($_ppcfg(Sound,AutoGet))) set %.ss.dir $_findsound(%.ss.file) if (%.ss.dir == $null) { set %.ss.color $remove(%col.dark,,,) | set %.ss.coloract $colour(act) } :dispit if ($3 == $null) { if ($chan == $null) { if ($_isopen($nick)) echo %.ss.color -i2 $nick [Sound %col.file $2 ] else echo %.ss.color -si2 [Sound %col.file $replace($2,?,$chr(32)) from $nick $+ ]] } else echo %.ss.color -i2 $chan [Sound %col.file $replace($2,?,$chr(32)) from $nick $+ ]] } else { set %.ss.wild * $+ $gettok(%.ss.file,1,46) $+ * if (%.ss.wild iswm $3-) unset %.ss.note else set %.ss.note %col.misc $+ ( $+ $nopath($2) $+ ) if ($chan == $null) { if ($query($nick) == $null) query $nick echo %.ss.coloract -i2 $nick ñ $nick $3- $+ %.ss.note } else echo %.ss.coloract -i2 $chan ñ $nick $3- $+ %.ss.note } if ((%.ss.dir != $null) && (%.+ss.play)) { if ((%_away.why == $null) || (%+accept.sounds.away)) splay %.ss.dir } elseif (%.ss.dir != $null) { _dynpop.rot snd 8 $nopath(%.ss.dir) _dynpop.rot spath 8 %.ss.dir } elseif (%-soundfld. [ $+ [ $site ] ] > 3) return elseif (($_ppcfg(Sound,Autoget)) && ((%.ss.dir == $null) || ($_ppcfg(Sound,AutoGetRemember)))) { unset %.auto.cmd set %.auto.text $_s2p($strip($3-)) if (! isin %.auto.text) set %.auto.cmd $gettok($_rchop($pos(%.auto.text,!),%.auto.text),1,127) elseif (Type isin %.auto.text) set %.auto.cmd $gettok($_rchop($calc(5 + $pos(%.auto.text,Type)),%.auto.text),1,127) elseif (Type: isin %.auto.text) set %.auto.cmd $gettok($_rchop($calc(6 + $pos(%.auto.text,Type:)),%.auto.text),1,127) elseif (toget isin %.auto.text) set %.auto.cmd $gettok($_rtok(2,127,$left($pos(%.auto.text,toget),%.auto.text)),1,127) elseif (toleech isin %.auto.text) set %.auto.cmd $gettok($_rtok(2,127,$left($pos(%.auto.text,toleech),%.auto.text)),1,127) elseif (forthis isin %.auto.text) set %.auto.cmd $gettok($_rtok(2,127,$left($pos(%.auto.text,forthis),%.auto.text)),1,127) set %.auto.chr $left(%.auto.cmd,1) if ((%.auto.chr isletter) || (%.auto.chr isnum) || ($len(%.auto.cmd) == 1) || ($count(%.auto.cmd,%.auto.chr) > 1)) unset %.auto.cmd if ($_ppcfg(Sound,AutoGetRemember)) { set %.auto.old $_ppcfg(AutoGet,$mask($fulladdress,3)) if (%.auto.old == off) halt if (%.auto.cmd == $null) set %.auto.cmd %.auto.old else _writecfg AutoGet $mask($fulladdress,3) %.auto.cmd } if (%.ss.dir != $null) halt set %.auto.ext $_rtok(1,46,$2) set %.auto.allow $replace($_ppcfg(Sound,AutoGetTypes),.,$chr(32)) set %.auto.num $_numtok(32,%.auto.allow) :loop if ($gettok(%.auto.allow,%.auto.num,32) iswm %.auto.ext) goto ok if ($_vd(.auto.num) > 0) goto loop halt :ok if ((%.auto.cmd == $null) && ($_ppcfg(Sound,AutoGetGuess))) set %.auto.cmd ! $+ $nick if (%.auto.cmd != $null) { if (($_ppcfg(Sound,AutoGetPrivate)) || ($chan == $null)) msg $nick %.auto.cmd $2 else msg $chan %.auto.cmd $2 _timersinc 15 -isaway. $+ $nick _timersinc 300 -leechreq. $+ $fulladdress } } halt } on 1:chat:SOUND *:{ set %.ss.file $_ffprep($nopath($remove($2,$chr(1)))) set %.ss.extn $_mapext($_rtok(1,46,%.ss.file)) if ((%.ss.extn == mp2) || (%.ss.extn == mp3)) set %.ss.extn mp if (%+accept. [ $+ [ %.ss.extn ] ] != $true) unset %.ss.dir else set %.ss.dir $_findsound(%.ss.file) if (%.ss.dir != $null) if ((%_away.why == $null) || (%+accept.sounds.away)) splay %.ss.dir } ; ----------------------------------------------------- ; Lets other people leech ; ----------------------------------------------------- on 1:text:%leech.cmd.mask:*:if (($chan == $null) && ($_not($_isopen($nick)))) closemsg $nick | _doleech $1- on 1:chat:%leech.cmd.mask:_doleech $1- alias -l _doleech { unset %.+halt if (@ isin %leech.route) open @Leech if (($_genflood(leech,-leech. [ $+ [ $site ] ] ,1)) || ($_genflood(leech,-recd.leech,1))) { if (%.+halt) halt if (%leech.route != none) disprs %leech.route %col.leech $+ [Leech] Request from %col.target $+ $nick $+ ignored- Flood protection " $+ %col.info1 $+ $1- $+ " inc %_leech.ignored _leechtitle halt } if (%+leech.knownonly) { if (($ulevel < 2) && ($nick !isnotify)) { if (%leech.route != none) disprs %leech.route %col.leech $+ [Leech] Request from %col.target $+ $nick $+ ignored- User not in userlist or notify " $+ %col.info1 $+ $1- $+ " inc %_leech.ignored _leechtitle halt } } if (. isin $right($2,4)) set %.leech.file $2 else set %.leech.file $2- set %.leech.ext $_rtok(1,46,%.leech.file) if ((? isin %.leech.ext) || (* isin %.leech.ext) || (%.leech.ext == $null)) goto badext set %.leech.allow $replace($_ppcfg(Sound,LeechTypes),.,$chr(32)) set %.leech.num $_numtok(32,%.leech.allow) :loop if ($gettok(%.leech.allow,%.leech.num,32) iswm %.leech.ext) goto ok if ($_vd(.leech.num) > 0) goto loop :badext _qnotice $nick Sorry, you can't leech files of that type if (%leech.route != none) disprs %leech.route %col.leech $+ [Leech] Request from %col.target $+ $nick $+ invalid- Unleechable file type " $+ %col.info1 $+ $1- $+ " inc %_leech.invalid _leechtitle halt :ok if ($_numsend($nick) >= $_ppcfg(Sound,LeechMax)) { _qnotice $nick Please wait until your current files finish before requesting another if (%leech.route != none) disprs %leech.route %col.leech $+ [Leech] Request from %col.target $+ $nick $+ invalid- Max DCC sends reached " $+ %col.info1 $+ $1- $+ " inc %_leech.invalid _leechtitle halt } set %.leech.filef $_findsound(%.leech.file) if (%.leech.filef == $null) { if (%leech.route != none) disprs %leech.route %col.leech $+ [Leech] Request from %col.target $+ $nick $+ invalid- No matching files " $+ %col.info1 $+ $1- $+ " _qnotice $nick Sorry, I have no files matching %.leech.file inc %_leech.invalid _leechtitle halt } _timersinc 15 -isaway. $+ $nick if ($chr(32) isin %.leech.filef) .dcc send $nick " $+ %.leech.filef $+ " else .dcc send $nick %.leech.filef if (%leech.route != none) disprs %leech.route %col.leech $+ [Leech] Request from %col.target $+ $nick $+ filled- Sent %col.info2 $+ %.leech.filef $+ " $+ %col.info1 $+ $1- $+ " inc %_leech.sent _leechtitle halt } alias -l _leechtitle { if ($_not($_isopen(@Leech))) return unset %.title if (%_leech.sent > 0) set %.title %_leech.sent files sent, if (%_leech.invalid > 0) set %.title %.title %_leech.invalid invalid requests, if (%_leech.ignored > 0) set %.title %.title %_leech.ignored requests ignored, titlebar @Leech $_lchop(1,%.title) } ; ----------------------------------------------------- ; Basic sound commands ; ----------------------------------------------------- alias wav if ($1 == $null) _dosnd Wave .wav *.wav $_wavedir | elseif (\ isin $1-) _dosnd Wave .wav *.wav $1- | else _dosnd Wave .wav * $+ $_ffprep($replace($1-,$chr(32),*)) $+ *.wav $_wavedir alias mid if ($1 == $null) _dosnd Midi .mid *.mid $_mididir | elseif (\ isin $1-) _dosnd Midi .mid *.mid $1- | else _dosnd Midi .mid * $+ $_ffprep($replace($1-,$chr(32),*)) $+ *.mid $_mididir alias mp if ($1 == $null) _dosnd MP2/MP3 .mp *.mp? $_mpdir | elseif (\ isin $1-) _dosnd MP2/MP3 .mp *.mp? $1- | else _dosnd MP2/MP3 .mp * $+ $_ffprep($replace($1-,$chr(32),*)) $+ *.mp? $_mpdir alias mp2 if ($1 == $null) _dosnd MP2 .mp *.mp2 $_mpdir | elseif (\ isin $1-) _dosnd MP2 .mp *.mp2 $1- | else _dosnd MP2 .mp * $+ $_ffprep($replace($1-,$chr(32),*)) $+ *.mp2 $_mpdir alias mp3 if ($1 == $null) _dosnd MP3 .mp *.mp3 $_mpdir | elseif (\ isin $1-) _dosnd MP3 .mp *.mp3 $1- | else _dosnd MP3 .mp * $+ $_ffprep($replace($1-,$chr(32),*)) $+ *.mp3 $_mpdir alias randwav wav * alias randmid mid * alias randmp mp * alias randmp2 mp2 * alias randmp3 mp3 * alias wavrand wav * alias midrand mid * alias mprand mp * alias mp2rand mp2 * alias mp3rand mp3 * alias rsound inc %_repnum | if ((%_repnum < 1) || (%_repnum > 10)) set %_repnum 1 | set %.ds.file %_last.sound | set %.ds.reas repeats.repeats again.plays yet again.here we go again.is it dead yet?.broken record it is.is addicted to.play it again, sam.tired of this song yet?.whooooooohoooooo! | set %.ds.play $_s2p($gettok(%.ds.reas,%_repnum,46)) | _finsound alias rrand rsound alias dsound { if (%_last.sound == $null) return _askyn _dsnd2 Delete $nopath(%_last.sound) $+ ? } alias cdesc { set %.snd $1- if (%.snd == $null) set %.snd %_last.sound if (%.snd == $null) return set %.snd $nopath(%.snd) writeini $_ppdir $+ sound.ini description %.snd (none) if ($_isopen(@Roulette)) rline @Roulette $sline(@Roulette,1).ln $_getexp($sline(@Roulette,1)) else dispa Description for %col.target $+ %.snd $+ cleared. } alias desc { set %.snd $1- if (%.snd == $null) set %.snd %_last.sound if (%.snd == $null) return set %.snd $nopath(%.snd) set %.desc $_ppdesc(%.snd) _pentry _findesc2 $+ $_s2p(%.desc) $_ New description for file %.snd $+ ? } alias _findesc2 { if ($1 == $null) writeini $_ppdir $+ sound.ini description %.snd (none) else writeini $_ppdir $+ sound.ini description %.snd $1- if ($_isopen(@Roulette)) { set %_+roulcolor $true | rline @Roulette $sline(@Roulette,1).ln %col.info1 $+ $_s2f($1-) $+ $chr(160) $_getexp($sline(@Roulette,1)) } } alias _dsnd2 { remove %_last.sound if (%_last.soundline != $null) { if (%_last.soundindex != $null) { write -dl [ $+ [ $_i(%_last.soundline) ] ] %_last.soundindex write -l1 %_last.soundindex $_j($lines(%_last.soundindex)) } if (%_last.soundrate != $null) { write -dl [ $+ [ $_i(%_last.soundline) ] ] %_last.soundrate write -l1 %_last.soundrate $_j($lines(%_last.soundrate)) } } unset %_last.sound* } alias drand dsound alias z { if ($1 == $null) _quickhelp /z set %.ext $_mapext($remove($1,.)) if ($findtok(%soundfile.extmap2,%.ext,32) == $null) set %.mask *. $+ %.ext | else set %.mask *.* set %.name %soundfile. [ $+ [ %.ext ] ] if (%.name == $null) set %.name Custom Sound set %.name $_s2f(%.name) if ($2 == $null) _dosnd %.name . $+ %.ext %.mask $_ppcfg(Sound, [ [ %.ext ] $+ ] Dir) elseif (\ isin $2-) _dosnd %.name . $+ %.ext %.mask $2- else { set %.mask * $+ $_ffprep($replace($2-,$chr(32),*)) $+ *. _dosnd %.name . $+ %.ext $_maprev(%.ext,%.mask) $_ppcfg(Sound, [ [ %.ext ] $+ ] Dir) } } alias zrand if ($1 == $null) _quickhelp /zrand | z $1 * alias randz zrand $1 ; ----------------------------------------------------- ; Continuous midis ; ----------------------------------------------------- #continuemidi off on 1:midiend:{ unset %.ds.line %_last.soundindex %_last.soundrate if (%+index.mid) { set %_last.soundindex $_ppdir $+ mid-list.txt :skipped set %.ds.line $read -l0 %_last.soundindex set %.ds.line $r(1,%.ds.line) set %.ds.file $read -nl [ $+ [ %.ds.line ] ] %_last.soundindex if (%+dynrate.mid) { set %_last.soundrate $_ppdir $+ mid-rate.txt set %.ds.rating $read -nl [ $+ [ %.ds.line ] ] %_last.soundrate set %.ds.rating $gettok(%.ds.rating,1,32) if (%.ds.rating > 0) { set %.ds.skip $r(1,$_i(%.ds.rating)) if (%.ds.skip <= %.ds.rating) goto skipped } } } else set %.ds.file $_randfile(*.mid,$_mididir) set %_last.soundline %.ds.line _title $nopath(%.ds.file) splay %.ds.file } #continuemidi end ; ----------------------------------------------------- ; Playlist generation ; ----------------------------------------------------- ; /playlist (type) (number) (mask) ; type is 1/2/3 or mp2/mp3 (1=mp2 + mp3) and defaults to 1 ; number defaults to 40, mask to * ; type and number can be switched. alias playlist { .timer918 off | .timer921 off disps-div disps Generating playlist... set %.pl.max 40 | set %.pl.typen 1 | set %.pl.mask * | set %.pl.param $1- if ($remove($1,mp) isin 1.2.3) { set %.pl.typen $remove($1,mp) | set %.pl.param $2- } if ($gettok(%.pl.param,1,32) isnum) { set %.pl.max $gettok(%.pl.param,1,32) | set %.pl.param $gettok(%.pl.param,2-,32) } if ($remove($gettok(%.pl.param,1,32),mp) isin 1.2.3) { set %.pl.typen $remove($gettok(%.pl.param,1,32),mp) | set %.pl.param $gettok(%.pl.param,2-,32) } if (%.pl.param != $null) set %.pl.mask * $+ $_ffprep($gettok($replace(%.pl.param,$chr(32),*),1,46)) $+ * set %.pl.type .mp? if (%.pl.typen == 3) { set %.pl.type .mp3 | if ($_mp3exe == $null) _error MP3 player not defined! } elseif (%.pl.typen == 2) { set %.pl.type .mp2 | if ($_mp2exe == $null) _error MP2 player not defined! } else { if ($_mp3exe == $null) { if ($_mp2exe == $null) _error Neither MP2 nor MP3 player is defined! disps MP3 player not defined- Only playlisting MP2s. set %.pl.type .mp2 } elseif ($_mp2exe == $null) { set %.pl.type .mp3 | disps MP2 player not defined- Only playlisting MP3s. } elseif ($_mp2exe != $_mp3exe) { set %.pl.type .mp3 | disps MP2 and MP3 players differ- Only playlisting MP3s. } } set %.pl.mask %.pl.mask $+ %.pl.type set %.pl.dir $_mpdir if (%.pl.dir == $null) _error Directory for MP2/MP3s not defined! if ((%.pl.mask == *.mp?) && (%+index.mp)) { set %.pl.index $_ppdir $+ mp-list.txt if ($_not($exists(%.pl.index))) _error Index file for MP2/MP3 files not created! (/mpindex to create) set %.pl.num $read -l0 %.pl.index if (%+dynrate.mp) { set %.pl.ratefile $_ppdir $+ mp-rate.txt if ($_not($exists(%.pl.ratefile))) _error Ratings file for MP2/MP3 files not created! (re-run indexer- /mpindex) } else unset %.pl.ratefile } else { unset %.pl.index set %.pl.num $_countfiles(%.pl.mask,%.pl.dir) if (%.pl.num == 0) _error No files found matching $+ %.pl.mask $+ } _progress.1 Generating playlist... (files $+ %.pl.mask $+ ) if (%.pl.type == .mp2) set %.pl.exe $_mp2exe else set %.pl.exe $_mp3exe if ($left(%.pl.mask,2) == *.) disps %.pl.num files found. else disps %.pl.num files found (matching $+ %.pl.mask $+ ) set %.pl.file $_ppdir $+ playlist if ((maplay isin %.pl.exe) || (mp2win isin %.pl.exe)) set %.pl.file %.pl.file $+ .lst else set %.pl.file %.pl.file $+ .m3u if ($exists(%.pl.file)) .remove %.pl.file set %.pl.do %.pl.max if (%.pl.num <= $int($calc(%.pl.max / 4))) set %.pl.do %.pl.num elseif (%.pl.num <= $int($calc(%.pl.max / 2))) set %.pl.do $int($calc(%.pl.max / 4)) elseif (%.pl.num <= $int($calc(%.pl.max + %.pl.max / 4))) set %.pl.do $int($calc(%.pl.num - %.pl.max / 4)) if (%.pl.do < %.pl.max) disps Only making list of %.pl.do files. (not enough found to pick %.pl.max randomly) else disps Making list of %.pl.max files. unset %.pl.did | set %.pl.cur 1 :file set %.pl.n $r(1,%.pl.num) if ($findtok(%.pl.did,%.pl.n,32) != $null) goto file if (%.pl.index == $null) set %.pl.picked $_pickfile(%.pl.n,%.pl.mask,%.pl.dir) else { set %.pl.picked $read -nl [ $+ [ %.pl.n ] ] %.pl.index if (%.pl.ratefile != $null) { set %.pl.rating $read -nl [ $+ [ %.pl.n ] ] %.pl.ratefile set %.pl.rating $gettok(%.pl.rating,1,32) if (%.pl.rating > 0) { set %.pl.skip $r(1,$calc(%.pl.rating + 2)) if (%.pl.skip <= $_i(%.pl.rating)) goto file } } } write %.pl.file %.pl.picked set %.pl.perc $int($calc(%.pl.cur * 100 / %.pl.do)) _progress.2 %.pl.perc %.pl.cur $+ / $+ %.pl.do - %.pl.picked set %.pl.did %.pl.did %.pl.n if ($_vi(.pl.cur) <= %.pl.do) goto file window -c @Progress disps Playlist complete, running player. if (%+minimize.mp) set %.to.min -n else unset %.to.min if ($chr(32) isin $mircdir) run %.to.min %.pl.exe " $+ $mircdir $+ %.pl.file $+ " else run %.to.min %.pl.exe %.pl.file disps-div } alias playlist2 playlist 2 $1- alias playlist3 playlist 3 $1- ; ----------------------------------------------------- ; mIRC sound command ; replacements ; ----------------------------------------------------- alias sound { if ($1 == $null) _quickhelp /sound if (($_isopen($1)) || (. !isin $1)) { if ($2 == $null) _quickhelp /sound | set %.ss.to $1 | set %.ss.file $2 | set %.ss.msg $3- } else { if ((Status isin $active) || ($left($active,1) == @)) set %.ss.to $null | else set %.ss.to $active | set %.ss.file $1 | set %.ss.msg $2- } if (\ !isin %.ss.file) set %.ss.file $_findsound($replace($replace(%.ss.file,▓,2),│,3)) else set %.ss.file $replace(%.ss.file,?,$chr(32)) if (%.ss.file == $null) _error Sound file not found set %.ss.extn $_mapext($_rtok(1,46,%.ss.file)) if ((%.ss.extn == mp2) || (%.ss.extn == mp3)) set %.ss.extn mp if (%+local. [ $+ [ %.ss.extn ] ] ) set %.ss.to $null splay %.ss.file if (%.ss.msg == $null) { set %.ss.show -> [Sound %col.file $nopath(%.ss.file) ] | set %.ss.color $remove(%col.dark,,,) } else { set %.ss.show ñ $me %.ss.msg | set %.ss.color $colour(act) } if (= isin %.ss.to) { .msg %.ss.to SOUND $nopath($replace(%.ss.file,$chr(32),?)) %.ss.msg $+ echo %.ss.color -t2 %.ss.to %.ss.show } elseif (%.ss.to == $null) echo %.ss.color -si2 %.ss.show else { if (((%.+allwrap) || (%+sounds.ame)) && ($_ischan(%.ss.to))) { set %.ss.to $_s2c($_getchans) set %.ss.nums $_numtok(44,%.ss.to) :sister echo %.ss.color -i2 $gettok(%.ss.to,%.ss.nums,44) %.ss.show if ($_vd(.ss.nums) > 0) goto sister } else { if ($_isopen(%.ss.to)) echo %.ss.color -i2 %.ss.to %.ss.show else echo %.ss.color -si2 -> %.ss.to %.ss.show } _qc %.ss.to SOUND $nopath($replace(%.ss.file,$chr(32),?)) %.ss.msg } } alias splay { if ($1 == $null) _quickhelp /splay if ($1 == stop) { splay -wm stop | return } if (\ !isin $1-) set %.to.play $_findsound($replace($replace($1-,▓,2),│,3)) else set %.to.play $1- unset %.to.exe set %.to.extn $_mapext($_rtok(1,46,%.to.play)) if (%.to.extn == mp2) { set %.to.exe $_mp2exe if (%.to.exe == $null) _error MP2 player not defined! } elseif (%.to.extn == mp3) { set %.to.exe $_mp3exe if (%.to.exe == $null) _error MP3 player not defined! } elseif (%.to.extn isin wav.mid) splay " $+ %.to.play $+ " else { set %.to.exe %.to.extn $+ Player set %.to.exe $_ppcfg(Sound,%.to.exe) if (%+minimize. [ $+ [ %.to.extn ] ] ) set %.to.min -n else unset %.to.min if ($chr(32) isin %.to.play) run %.to.min %.to.exe " $+ %.to.play $+ " else run %.to.min %.to.exe %.to.play unset %.to.exe } if (%.to.exe != $null) { if ((maplay isin %.to.exe) || (mp2win isin %.to.exe)) set %.to.list playlist.lst else set %.to.list playlist.m3u write -c $_ppdir $+ %.to.list %.to.play if (%+minimize.mp) set %.to.min -n else unset %.to.min if ($chr(32) isin $mircdir) run %.to.min %.to.exe " $+ $mircdir $+ $_ppsub $+ \ $+ %.to.list $+ " else run %.to.min %.to.exe $_ppdir $+ %.to.list } _dynpop.rot snd 8 $nopath(%.to.play) _dynpop.rot spath 8 %.to.play _recfile2 %.to.play set %_last.sound %.to.play unset %_last.soundline } ; ----------------------------------------------------- ; Internal sound commands and ; identifiers ; ----------------------------------------------------- alias _findsound return $_randfile($_ffprep($1-),$_thedir($_rtok(1,46,$1-))) alias _dosnd { unset %_repnum if ((* isin $3-) && (($4 == $null) || ($4 == $chr(59)))) _error Directory for $1 $+ s not defined! set %.ds.play %soundact [ $+ [ $2 ] ] if (%.ds.play == $null) set %.ds.play plays else set %.ds.play $_s2p(%.ds.play) unset %.ds.line %_last.soundindex %_last.soundrate if ($gettok($3,1,46) != *) { if ($left($3,4) == ***.) { set %.ds.play randomly $+ %.ds.play if (%+index [ $+ [ $2 ] ] ) { set %_last.soundindex $_ppdir $+ $remove($2,.) $+ -list.txt if ($exists(%_last.soundindex)) { :skipped set %.ds.line $read -l0 %_last.soundindex set %.ds.line $calc(($ticks + $r(1,%.ds.line)) % %.ds.line + 1) set %.ds.file $read -nl [ $+ [ %.ds.line ] ] %_last.soundindex } else { if ($2 isin .mp.wav.mid) _error Index file for $1 files not created! (/ $+ $remove($2,.) $+ index to create) else _error Index file for $1 files not created! (/zindex remove($2,.) to create) } if (%+dynrate [ $+ [ $2 ] ] ) { set %_last.soundrate $_ppdir $+ $remove($2,.) $+ -rate.txt if ($exists(%_last.soundrate)) set %.ds.rating $read -nl [ $+ [ %.ds.line ] ] %_last.soundrate else _error Ratings file for $1 files not created! (re-run indexer) set %.ds.rating $gettok(%.ds.rating,1,32) if (%.ds.rating > 0) { set %.ds.skip $r(1,$_i(%.ds.rating)) if (%.ds.skip <= %.ds.rating) goto skipped .timer921 1 60 _keeprate %.ds.line %_last.soundrate } if (%_killrating != $null) { set %.ds.rating $read -nl [ $+ [ %_killrating ] ] %_last.soundrate if (%.ds.rating != $null) write -l [ $+ [ $_i(%_killrating) ] ] %_last.soundrate $_i($gettok(%.ds.rating,1,32)) } set %_killrating %.ds.line .timer918 1 15 unset %_killrating } } else set %.ds.file $_randfile($3,$4-) } elseif (* !isin $3-) { set %.ds.file $3- if ($_not($exists($3-))) _error Sound file $+ $3- $+ not found } else { set %.ds.do $3 | unset %.cf.win %.+cf.keep if ($left($3,2) == *?) { set %.ds.do * $+ $_rchop(2,%.ds.do) | set %.cf.win @Roulette | set %.+cf.keep $true | window -c @Roulette | open @Roulette } elseif ($left($3,2) == *!) set %.ds.do * $+ $_rchop(2,%.ds.do) elseif (%+roulette [ $+ [ $2 ] ] ) { set %.cf.win @Roulette | window -c @Roulette | open @Roulette } set %.ds.file $_randfile(%.ds.do,$4-) if (%.ds.file == @) { titlebar @Roulette selection for sound files ( $+ $line(@Roulette,0) matches) iline @Roulette 1 - Double-click on a file to play it - (right-click for other options) if (%+roulette.retain) iline @Roulette 2 - Window will stay open on play (double-click here to toggle) - else iline @Roulette 2 - Window will close on play (double-click here to toggle) - iline @Roulette 3 $chr(160) iline -s @Roulette 4 - Double-click here to select one randomly - iline @Roulette 5 - Double-click here to playlist all files - iline @Roulette 6 $chr(160) window -arb @Roulette halt } } if (%.ds.file == $null) { window -c @Roulette | _error No $1 files found matching $+ $3 $+ } } else { .timer918 off | .timer921 off set %.ds.where $gettok($4-,1,59) if ($right(%.ds.where,1) != \) set %.ds.where %.ds.where $+ \ set %.ds.where %.ds.where $+ $3 set %.ds.query '' $+ $1 to play?'' _timer924off set %.ds.file [ $dir= [ $+ [ %.ds.query ] ] %.ds.where ] _timer924on if (%.ds.file == $null) halt } if (~ isin %.ds.file) set %.ds.file $findfile($nofile(%.ds.file),$nopath(%.ds.file),1) unset %.ds.act set %.ds.descs %+desc [ $+ [ $2 ] ] if (%+askact [ $+ [ $2 ] ] ) _pentry _finsound Action to go with $nopath(%.ds.file) $+ ?( $+ %col.custdark $+ Enter for %col.custdark $+ default.) _finsound %.ds.act } alias _finsound { if ($1 == $null) { set %.gm.desc $_ppdesc($nopath(%.ds.file)) if ((%.gm.desc == $null) && (%.ds.descs)) _pentry _findesc Description for file %.ds.file $+ ?( $+ %col.custdark $+ Enter for %col.custdark $+ none; You won't be asked again for this file.) sound $replace(%.ds.file,$chr(32),?) $_soundmsg(%.ds.play,%.ds.descs, %.ds.file) } else sound $replace(%.ds.file,$chr(32),?) $1- set %_last.soundline %.ds.line } alias _findesc { if ($1 == $null) writeini $_ppdir $+ sound.ini description $nopath(%.ds.file) (none) else writeini $_ppdir $+ sound.ini description $nopath(%.ds.file) $1- sound $replace(%.ds.file,$chr(32),?) $_soundmsg(%.ds.play, %+desc [ $+ [ $2 ] ] , %.ds.file) set %_last.soundline %.ds.line } alias _keeprate { set %.kr.rating $read -nl [ $+ [ $1 ] ] $2- if (%.kr.rating == $null) halt if (K isin %.kr.rating) write -l [ $+ [ $_i($1) ] ] $2- 0 else write -l [ $+ [ $_i($1) ] ] $2- %.kr.rating K } ; _soundindex MP MP2/3 *.mp? $_mpdir alias -l _soundindex { set %.si.ini $_ppdir $+ $1 $+ -list.txt if (%+dynrate. [ $+ [ $1 ] ] ) { set %.si.inirate $_ppdir $+ $1 $+ -rate.txt if ($exists(%.si.inirate)) { set %.si.oldrate $_ppdir $+ oldrate.dat if ($exists(%.si.oldrate)) .remove %.si.oldrate set %.si.savet $_j($lines(%.si.ini)) set %.si.savec 1 _progress.1 Saving and indexing old ratings... ( $+ %.si.savet ratings) :loopsv set %.si.oldf $read -nl [ $+ [ %.si.savec ] ] %.si.ini if ($_vi(.si.mup) > 5) { set %.si.perc $int($calc(%.si.savec * 100 / %.si.savet)) _progress.2 %.si.perc %.si.savec $+ / $+ %.si.savet - %.si.oldf unset %.si.mup } set %.si.oldr $read -nl [ $+ [ %.si.savec ] ] %.si.inirate write %.si.oldrate $_ffprep(%.si.oldf) %.si.oldr write %.si.oldrate $_ffprep($nopath(%.si.oldf)) %.si.oldr if ($_vi(.si.savec) <= %.si.savet) goto loopsv window -c @Progress } else unset %.si.oldrate } else unset %.si.inirate window -nlh @IndexTemp set %.cf.win @IndexTemp set %.si.total $_countfiles($3,$4-) if (%.si.total == 0) _error No files found to index! _progress.1 Generating $2 index... ( $+ %.si.total files) if ($exists(%.si.ini)) .remove %.si.ini iline @IndexTemp 1 %.si.total .savebuf @IndexTemp %.si.ini if (%.si.inirate != $null) { dline @IndexTemp 1 set %.si.cur 1 :loop set %.si.file $line(@IndexTemp,%.si.cur) if ($_vi(.si.mup) > 5) { set %.si.perc $int($calc(%.si.cur * 100 / %.si.total)) _progress.2 %.si.perc %.si.cur $+ / $+ %.si.total - %.si.file unset %.si.mup } if (%.si.oldrate != $null) { set %.si.prevrate $read -ns [ $+ [ $_ffprep(%.si.file) ] ] %.si.oldrate if (%.si.prevrate == $null) set %.si.prevrate $read -ns [ $+ [ $_ffprep($nopath(%.si.file)) ] ] %.si.oldrate if (%.si.prevrate == $null) rline @IndexTemp %.si.cur 0 else rline @IndexTemp %.si.cur %.si.prevrate } else rline @IndexTemp %.si.cur 0 if ($_vi(.si.cur) <= %.si.total) goto loop if ($exists(%.si.inirate)) .remove %.si.inirate iline @IndexTemp 1 %.si.total .savebuf @IndexTemp %.si.inirate if (%.si.oldrate != $null) if ($exists(%.si.oldrate)) .remove %.si.oldrate } window -c @IndexTemp _progress.2 100 Done! } alias mpindex _soundindex MP MP2/3 $_maprev(mp2,*.) $+ ; $+ $_maprev(mp3,*.) $_mpdir alias midindex _soundindex MID Midi $_maprev(mid,*.) $_mididir alias wavindex _soundindex WAV Wave $_maprev(wav,*.) $_wavedir alias zindex { if ($1 == $null) _quickhelp /zindex set %.ext $_mapext($remove($1,.)) set %.name %soundfile. [ $+ [ %.ext ] ] _soundindex %.ext $_s2f(%.name) $_maprev(%.ext,*.) $_ppcfg(Sound, [ [ %.ext ] $+ ] Dir) }